package com.szqhyxj.youxiangju.biz.partnerHome.home.equipmentrepayment;

import com.google.gson.annotations.SerializedName;
import com.szqhyxj.youxiangju.sys.BaseResult;
import com.szqhyxj.youxiangju.sys.RetrofitFacade;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by leung on 2018/11/20.
 */

public class EquipmentRepaymentModel {

    private interface PartnerEquipmentPaymentService{
        @FormUrlEncoded
        @POST("partner/getTradeDetail")
        Observable<BaseResult<EquipmentRepaymentEntity>> partnerEquipmentPayment(
                @Field("tradeType") int tradeType);
    }

    public static Observable<BaseResult<EquipmentRepaymentEntity>> getpartnerEquipmentPayment(int tradeType) {
        return RetrofitFacade.Companion.getRetrofit().create(PartnerEquipmentPaymentService.class).partnerEquipmentPayment(
                tradeType
        );
    }

    public static class EquipmentRepaymentEntity{

        @SerializedName("partnerIndexSubEntity")
        private PartnerIndexSubEntity partnerIndexSubEntity;

        @SerializedName("rewards")
        private Rewards rewards;

        @SerializedName("merchantSumTradeAmt")
        private int merchantSumTradeAmt;

        public void setPartnerIndexSubEntity(PartnerIndexSubEntity partnerIndexSubEntity){
            this.partnerIndexSubEntity = partnerIndexSubEntity;
        }

        public PartnerIndexSubEntity getPartnerIndexSubEntity(){
            return partnerIndexSubEntity;
        }

        public void setRewards(Rewards rewards){
            this.rewards = rewards;
        }

        public Rewards getRewards(){
            return rewards;
        }

        public void setMerchantSumTradeAmt(int merchantSumTradeAmt){
            this.merchantSumTradeAmt = merchantSumTradeAmt;
        }

        public int getMerchantSumTradeAmt(){
            return merchantSumTradeAmt;
        }

        @Override
         public String toString(){
            return
                "EquipmentRepaymentEntity{" +
                "partnerIndexSubEntity = '" + partnerIndexSubEntity + '\'' +
                ",rewards = '" + rewards + '\'' +
                ",merchantSumTradeAmt = '" + merchantSumTradeAmt + '\'' +
                "}";
            }
    }

    public static class PartnerIndexSubEntity{

        @SerializedName("sumTradeAmt")
        private int sumTradeAmt;

        @SerializedName("twentyMillionPeoples")
        private int twentyMillionPeoples;

        @SerializedName("hundredOfMillionPeoples")
        private int hundredOfMillionPeoples;

        public void setSumTradeAmt(int sumTradeAmt){
            this.sumTradeAmt = sumTradeAmt;
        }

        public int getSumTradeAmt(){
            return sumTradeAmt;
        }

        public void setTwentyMillionPeoples(int twentyMillionPeoples){
            this.twentyMillionPeoples = twentyMillionPeoples;
        }

        public int getTwentyMillionPeoples(){
            return twentyMillionPeoples;
        }

        public void setHundredOfMillionPeoples(int hundredOfMillionPeoples){
            this.hundredOfMillionPeoples = hundredOfMillionPeoples;
        }

        public int getHundredOfMillionPeoples(){
            return hundredOfMillionPeoples;
        }

        @Override
         public String toString(){
            return
                "PartnerIndexSubEntity{" +
                "sumTradeAmt = '" + sumTradeAmt + '\'' +
                ",twentyMillionPeoples = '" + twentyMillionPeoples + '\'' +
                ",hundredOfMillionPeoples = '" + hundredOfMillionPeoples + '\'' +
                "}";
            }
    }
}
